export const loadPlayer = function () {
  return new Promise(function (resolve, reject) {
    if (typeof JSPlugin !== 'undefined') {
      resolve(JSPlugin)
      return true
    }
    let script = document.createElement('script')
    script.type = 'text/javascript'
    script.src =
      'player/h5player.min.js'
    script.onerror = reject
    script.onload = resolve
    document.head.appendChild(script)
  })
}
